package com.coderman.common.lightmonitor.mapper;

import com.coderman.common.lightmonitor.entity.ServerConfigEntity;

import java.util.List;

/**
 * @Author fanchunshuai
 * @Date 2019/12/2 18
 * @Description:
 */
public interface ServerConfigMapper {

    /**
     *
     * @Title: save
     * @Description:新增或修改
     * @author:
     * @param @param dto
     * @param @param userId
     * @return 当前插入记录id
     * @throws
     */
    Long insert(ServerConfigEntity Entity) throws Exception;

    /**
     *
     * @Title: delete
     * @Description: 通过id删除数据
     * @author:
     * @param @param id
     * @return 0/1    返回类型
     * @throws
     */
    int delete(long id)  throws Exception;

    /**
     *
     * @Title: getById
     * @Description: 通过id查询
     * @author:
     * @param @param id
     * @return ServerConfigEntity   返回类型
     * @throws
     */
    ServerConfigEntity getById(Long id) throws Exception;


    /**
     *
     * @Title: getById
     * @Description: 通过id查询
     * @author:
     * @param @param id
     * @return 0/1
     * @throws
     */
    int  update(ServerConfigEntity entity) throws Exception;


    /**
     * 根据ip获取数据
     * @param ip
     * @return
     * @throws Exception
     */
    ServerConfigEntity getByIP(String ip) throws Exception;

    /**
     * 获取所有IP配置
     * @return
     * @throws Exception
     */
    List<ServerConfigEntity> getAll() throws Exception;
}
